#!/bin/sh

PATH=/sbin:/bin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin

if grep -q ^eggdrop: /etc/group; then
	echo There already is an eggdrop group on the system.
	ADDUSER_OPT="-G eggdrop"
fi

if grep -q ^eggdrop: /etc/passwd; then
	echo There already is an eggdrop user on the system.
else
	echo -n "No eggdrop user found, creating it... "
	adduser -h /opt/share/eggdrop -g "eggdrop daemon" -s /bin/false -D -H  $ADDUSER_OPT eggdrop > /dev/null 2>&1
	echo done
fi
